package com.local.seckill.mapper;

import com.local.seckill.pojo.Seckill;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SeckillMapper {

    //查询数据列表，支持翻页和搜索
    public List<Seckill> findSeckillList(Integer start, Integer limit, String sort, String order, Integer goodsId, Integer seckillStatus, String startTime, String endTime, Integer isDeleted);


    //查询数量
    public Integer getTotalSeckills(Integer goodsId, Integer seckillStatus, String startTime, String endTime, Integer isDeleted);

    /**
     * 通过id查询
     * @param seckillId
     * @return
     */
    public Seckill selectById(Integer seckillId);


    /**
     * 新增
     * @param seckill
     * @return
     */
    public Integer save(Seckill seckill);


    /**
     * 修改
     * @param seckill
     * @return
     */
    public Integer update(Seckill seckill);


    /**
     * 逻辑删除id
     * @param seckillId
     * @return
     */
    public Integer delete(Integer seckillId);


    /**
     * 查询秒杀列表数据，用于秒杀页面首页的展示
     * @return
     */
    public List<Seckill> getList();
}
